<?php

class Domain_ShowAPI {

    public function getWeatherInfo( $cityName, $needMoreDay, $needIndex, $needHourData ) {
        $model = new Model_ShowAPI();
        if( is_numeric($cityName) ){
            $areaId = $cityName;
            $area = '';
        }else{
            $areaId = '';
            $area = $cityName;
        }
        $weatherInfo = $model->getWeatherInfo( $areaId, $area, $needMoreDay, $needIndex, $needHourData );
        $weatherInfo['thanks'] = 'https://www.showapi.com/';
        if( $weatherInfo['ret_code'] != 0 ){
            return '';
        }
        unset($weatherInfo['cityInfo']);
        unset($weatherInfo['ret_code']);
        unset($weatherInfo['time']);
        unset($weatherInfo['now']['aqiDetail']);
        return $weatherInfo;
    }
}